/*
 * Created by JFormDesigner on Fri Mar 09 06:44:35 PST 2012
 */

package fussbudget.gui;

import java.awt.*;
import java.awt.BorderLayout;

import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.LineBorder;
import com.miginfocom.beans.*;

import org.jdesktop.swingx.HorizontalLayout;

import com.jformdesigner.model.SwingColor;
import com.miginfocom.beans.DateAreaBean;
import com.miginfocom.beans.DateGroupConnectorBean;
import com.miginfocom.beans.DateSpinnerBean;
import com.miginfocom.beans.NorthCategoryHeaderBean;
import com.miginfocom.calendar.category.Category;

/**
 * @author rich helvey
 */
public class CalendarPanel extends JPanel {
	Category	root;

	public CalendarPanel(Category root) {
		this.root = root;
		initComponents();
	}

	private void initComponents() {
		// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
		// Generated using JFormDesigner Evaluation license - rich helvey
		dateAreaBean1 = new DateAreaBean();
		panel1 = new JPanel();
		dateSpinnerBean1 = new DateSpinnerBean();
		categoryTreeBean1 = new CategoryTreeBean();
		dateGroupConnectorBean1 = new DateGroupConnectorBean();
		northCategoryHeaderBean1 = new NorthCategoryHeaderBean();
		dateHeaderBean1 = new DateHeaderBean();

		//======== this ========

		// JFormDesigner evaluation mark
		setBorder(new javax.swing.border.CompoundBorder(
			new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
				"JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
				javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
				java.awt.Color.red), getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});

		setLayout(new BorderLayout());

		//---- dateAreaBean1 ----
		dateAreaBean1.setWestDateHeader(dateHeaderBean1);
		dateAreaBean1.setBackgroundPaint(null);
		dateAreaBean1.setLabelNowBackground(new java.awt.Color(0, 255, 255));
		dateAreaBean1.setLabelNowFont(UIManager.getFont("Label.font"));
		dateAreaBean1.setLabelFont(UIManager.getFont("Label.font"));
		dateAreaBean1.setSecondaryDimensionLayout(null);
		dateAreaBean1.setBorder(LineBorder.createBlackLineBorder());
		dateAreaBean1.setOddColumnPaint(new com.jformdesigner.model.SwingColor(240, 240, 240));
		dateAreaBean1.setAutoscrolls(true);
		dateAreaBean1.setCategoryHeader(northCategoryHeaderBean1);
		dateAreaBean1.setWrapBoundaryCount(4);
		dateAreaBean1.setOddRowPaint(new com.jformdesigner.model.SwingColor(240, 240, 240));
		dateAreaBean1.setLabelAlignX(new com.miginfocom.util.gfx.geometry.numbers.AtFraction(0.01f));
		dateAreaBean1.setPrimaryDimension(javax.swing.SwingConstants.VERTICAL);
		dateAreaBean1.setDesignTimeHelp(false);
		dateAreaBean1.setActivityLayouts(new com.miginfocom.calendar.layout.ActivityLayout[] {
					new com.miginfocom.calendar.layout.TimeBoundsLayout(new com.miginfocom.util.gfx.geometry.numbers.AtFraction(-0.5f), new com.miginfocom.util.gfx.geometry.numbers.AtStart(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtEnd(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtStart(2.0f), new com.miginfocom.util.gfx.geometry.numbers.AtEnd(-2.0f), 2, null, null, null, new String[] {"TimeBounds"}, null)});
		dateAreaBean1.setLabelFirstInField(java.util.Calendar.YEAR);
		dateAreaBean1.setLabelForeground(Color.white);
		add(dateAreaBean1, BorderLayout.CENTER);

		//======== panel1 ========
		{
			panel1.setLayout(new HorizontalLayout(5));

			//---- dateSpinnerBean1 ----
			dateSpinnerBean1.setDateGroupConnector(dateGroupConnectorBean1);
			dateSpinnerBean1.setDateFormatString("MM-dd-yyyy");
			panel1.add(dateSpinnerBean1);
		}
		add(panel1, BorderLayout.SOUTH);
		add(categoryTreeBean1, BorderLayout.WEST);

		//---- dateGroupConnectorBean1 ----
		dateGroupConnectorBean1.setConnectedDateArea(dateAreaBean1);

		//---- dateHeaderBean1 ----
		dateHeaderBean1.setHeaderRows(new com.miginfocom.calendar.header.CellDecorationRow[] {
					new com.miginfocom.calendar.header.CellDecorationRow(
					com.miginfocom.util.dates.DateRangeI.RANGE_TYPE_CUSTOM,
					new com.miginfocom.util.dates.DateFormatList("E dd/MM/yyyy", null),
					new com.miginfocom.util.gfx.geometry.numbers.AtFixed(19.0f),
					new com.miginfocom.util.gfx.geometry.AbsRect(new com.miginfocom.util.gfx.geometry.numbers.AtStart(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtStart(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtEnd(0.0f), new com.miginfocom.util.gfx.geometry.numbers.AtEnd(0.0f), null, null, null),
					(java.awt.Paint[]) null,
					new java.awt.Paint[] {new java.awt.Color(0, 0, 0)},
					new com.miginfocom.util.repetition.DefaultRepetition(0, 1, null, null),
					new java.awt.Font[] {new java.awt.Font("Arial Unicode MS", 0, 11)},
					new java.lang.Integer[] {null},
					new com.miginfocom.util.gfx.geometry.numbers.AtFraction(0.5f),
					new com.miginfocom.util.gfx.geometry.numbers.AtFraction(0.5f))});
		// JFormDesigner - End of component initialization //GEN-END:initComponents
	}

	// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
	// Generated using JFormDesigner Evaluation license - rich helvey
	private DateAreaBean dateAreaBean1;
	private JPanel panel1;
	private DateSpinnerBean dateSpinnerBean1;
	private CategoryTreeBean categoryTreeBean1;
	private DateGroupConnectorBean dateGroupConnectorBean1;
	private NorthCategoryHeaderBean northCategoryHeaderBean1;
	private DateHeaderBean dateHeaderBean1;
	// JFormDesigner - End of variables declaration //GEN-END:variables
}
